package com.lxw.nonghe.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@Data
@Accessors(chain = true)
@TableName("t_chronic_disease_policy")
@ApiModel(value = "ChronicDiseasePolicy对象", description = "慢病政策表")
public class ChronicDiseasePolicy implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("政策唯一ID")
    @TableId(type = IdType.AUTO)
    private Integer policyId;

    @ApiModelProperty("政策适用年度")
    private Integer year;

    @ApiModelProperty("适用的疾病名称")
    private String diseaseName;

    @ApiModelProperty("年度报销封顶线（元）")
    private BigDecimal capAmount;

    @ApiModelProperty("报销比例（0-1之间的小数）")
    private BigDecimal reimbursementRate;

    @ApiModelProperty("关联疾病编码")
    private String diseaseCode;

    @ApiModelProperty("政策名称")
    private String policyName;

    @ApiModelProperty("生效日期")
    private Date effectiveDate;

    @ApiModelProperty("失效日期")
    private Date expiryDate;

    @ApiModelProperty("政策描述")
    private String description;

    @ApiModelProperty("状态(1-启用,0-禁用)")
    private Byte status;

    @ApiModelProperty("创建时间")
    private Date createTime;

    @ApiModelProperty("更新时间")
    private Date updateTime;

    // 验证status字段
    public void setStatus(Byte status) {
        if (status != null && (status == 0 || status == 1)) {
            this.status = status;
        } else {
            throw new IllegalArgumentException("status值必须为0或1");
        }
    }
}
